/**
 *   "System product type".toUpperCase().replace(/\s/g,'_')
 */

export const getLabelByValue = (list, value, defaultLabel = "--") => {
	const f = list.find(e => e.value == value);
	if (f && f.label) return f.label;
	return defaultLabel;
};
export const getArrayItem = (list, value) => {
	const f = list.find(e => e.value == value);
	if (f) return f;
	return {
		value,
		label: "--",
		type: ""
	};
};
export const SYNC_STOCK_TYPES = [
	{
		label: "可用库存",
		value: "1"
	},
	{
		label: "虚拟库存",
		value: "2"
	}
];
export const ENABLED_NUM_STATUS = [
	{
		value: 1,
		label: "启用",
		type: "success"
	},
	{
		value: 0,
		label: "禁用",
		type: "danger"
	}
];
export const YES_NO_NUM_STATUS = [
	{
		value: 1,
		label: "是",
		type: "success"
	},
	{
		value: 0,
		label: "否",
		type: "danger"
	}
];
/**系统商品类型 */
export const SYSTEM_PRODUCT_TYPE = [
	{
		value: "1",
		label: "单品"
	},
	{
		value: "2",
		label: "组合"
	}
];
// 销售状态：0下架 1上架
export const SKU_SALES_STATUS = [
	{
		value: "",
		label: "全部"
	},
	{
		value: "1",
		label: "上架"
	},
	{
		value: "0",
		label: "下架"
	}
];
export const SPU_STATUS = [
	{
		value: 1,
		label: "启用",
		type: "success"
	},
	{
		value: 2,
		label: "备用",
		type: ""
	},
	{
		value: 0,
		label: "禁用",
		type: "danger"
	}
];
// 库存同步状态
export const SPU_SYNC_STATUS = [
	{
		value: 1,
		label: "已开启"
	},
	{
		value: 0,
		label: "未开启"
	}
];
// 库存同步类型
export const SPU_SYNC_TYPE_STATUS = [
	{
		value: 1,
		label: "可用库存"
	},
	{
		value: 2,
		label: "虚拟库存"
	}
];
// SPU库存同步状态(二期)
export const SPU_SYNC_STATUS_2 = [
	{
		value: 1,
		label: "开启"
	},
	{
		value: 0,
		label: "禁止"
	},
	{
		value: 2,
		label: "部分开启"
	}
];
// 价格类型
export const SPU_PRICE_TYPE = [
	{
		value: 1,
		label: "零售价"
	},
	{
		value: 2,
		label: "市场价"
	},
	{
		value: 3,
		label: "成本价"
	},
	{
		value: 4,
		label: "采购价"
	},
	{
		value: 5,
		label: "其它价格1"
	},
	{
		value: 6,
		label: "其它价格2"
	},
	{
		value: 7,
		label: "其它价格3"
	},
	{
		value: 8,
		label: "其它价格4"
	},
	{
		value: 9,
		label: "其它价格5"
	}
];
// 其他属性
export const SPU_OTHER_ATTR = [
	{
		value: 1,
		label: "其它属性1 "
	},
	{
		value: 2,
		label: "其它属性2 "
	},
	{
		value: 3,
		label: "其它属性3 "
	},
	{
		value: 4,
		label: "其它属性4 "
	},
	{
		value: 5,
		label: "其它属性5 "
	}
];
// 是否为跑量商品
export const SKU_RUNNING_VOLUME_STATUS = [
	...YES_NO_NUM_STATUS,
	{
		value: 2,
		label: "是（默认）"
	}
];
// 是否匹配
export const SKU_MATCHORNOT_STATUS = [
	{
		value: 0,
		label: "待匹配"
	},
	{
		value: 1,
		label: "已匹配"
	}
];

// 匹配状态
export const SPU_MATCHORNOT_STATUS = [
	{
		value: 0,
		label: "待匹配"
	},
	{
		value: 1,
		label: "已匹配"
	},
	{
		value: 2,
		label: "部分匹配"
	}
];

// 退货去向
export const SKU_RETURN_DIRECTION_STATUS = [
	{
		value: 1,
		label: "销退入库"
	},
	{
		value: 2,
		label: "退回供应商"
	}
];
// 出库单状态
export const WAIT_SHIP = "wait-ship";
export const SHIPPED = "shipped";
export const CANCELLED = "cancelled";
export const OUTBOUND_STATUS = [
	{
		value: WAIT_SHIP,
		label: "待发货"
	},
	{
		value: SHIPPED,
		label: "已发货"
	},
	{
		value: "cancelled",
		label: "已作废"
	}
];

// 订单标签(部分)
export const OUTBOUND_ORDERLABEL = [
	{
		value: "0",
		label: "全部标签"
	},
	{
		value: "1",
		label: "无标签"
	},
	{
		value: "99",
		label: "异常标签"
	}
];
// 物流状态
export const OUTBOUND_LOGISTICS_STATUS = [
	{
		value: "0",
		label: "无运单号"
	},
	{
		value: "1",
		label: "已获取运单号"
	},
	{
		value: "2",
		label: "正在获取运单号"
	},
	{
		value: "3",
		label: "运单号不足"
	},
	{
		value: "-1",
		label: "接口报错"
	},
	{
		value: "5",
		label: "寄件人为空"
	},
	{
		value: "6",
		label: "未设置面单获取平台"
	},
	{
		value: "-1",
		label: "运单号已取消"
	}
];
// 快递单打印状态
export const OUTBOUND_PRINT_STATUS = [
	{
		value: 1,
		label: "已打印"
	},
	{
		value: 0,
		label: "未打印"
	}
];
// 订单商品数量
export const OUTBOUND_ORDER_GOODS_COUNT_STATUS = [
	{
		value: 1,
		label: "一单一件"
	},
	{
		value: 2,
		label: "一单多件"
	}
];

// 订单商品数量
export const OUTBOUND_REMAINING_DELIVERY_TIME = [
	{
		value: 1,
		label: "已超时"
	},
	{
		value: 2,
		label: "12小时内"
	},
	{
		value: 3,
		label: "24小时内"
	},
	{
		value: 4,
		label: "3天内"
	}
];

// 导入时商品处理
export const GOODS_DATA_HANDEL = [
	{
		value: 1,
		label: "跳过不处理"
	},
	{
		value: 2,
		label: "全部更新"
	}
];
// 导入时值处理
export const VALUE_DATA_HANDEL = [
	{
		value: 1,
		label: "跳过不处理"
	},
	{
		value: 2,
		label: "置空"
	}
];
// 导入时子商品处理
export const GOODS_SON_DATA_HANDEL = [
	{
		value: 1,
		label: "跳过不处理"
	},
	{
		value: 2,
		label: "全部更新"
	}
];
// 订单占用状态
export const ORDER_OCCUPY_STATUS = [
	{
		value: 0,
		label: "未占用"
	},
	{
		value: 1,
		label: "已占用"
	},
	{
		value: 2,
		label: "预占用"
	}
];
// 订单分拣状态
export const ORDER_SORT_STATUS = [
	{
		value: 0,
		label: "未分拣"
	},
	{
		value: 1,
		label: "部分分拣"
	},
	{
		value: 2,
		label: "分拣完成"
	}
];
// 已分拣数
export const ORDER_NUMBER = [
	{
		value: 0,
		label: "分拣数小于等于"
	},
	{
		value: 1,
		label: "分拣数等于"
	},
	{
		value: 2,
		label: "分拣数大于等于"
	}
];
// 唯一码状态
export const UNIQUECODE_STATUS = [
	{
		value: "wait-pickup",
		label: "待拿货"
	},
	{
		value: "pickup-ing",
		label: "拿货中"
	},
	{
		value: "wait-count",
		label: "待清点"
	},
    {
		value: "picked-up",
		label: "已拿货"
	},
	{
		value: "shipped",
		label: "已发货"
	},
	{
		value: "cancelled",
		label: "已作废"
	},
	// {
	// 	value: "sales_return",
	// 	label: "退货"
	// }
];

// 订单类型
export const ORDER_TYPE = [
	{
		value: 1,
		label: "一对一"
	},
	{
		value: 2,
		label: "一对多"
	}
];

// 异常标签
export const ABNORMAL_LABEL = [
	{
		value: 0,
		label: "普通异常"
	},
	{
		value: 1,
		label: "其他原因异常"
	},
	{
		value: 2,
		label: "明天有货异常"
	},
	{
		value: 3,
		label: "后天有货异常"
	},
	{
		value: 4,
		label: "三天后有货异常"
	},
	{
		value: 5,
		label: "不知何时有货异常"
	},
	{
		value: 6,
		label: "下架异常"
	},
	{
		value: 7,
		label: "门店未开门"
	}
];
export const GOODS_LABEL = [
	{
		id: "1",
		name: "库存"
	},
	{
		id: "2",
		name: "采购"
	},
	{
		id: "10",
		name: "异常"
	},
	{
		id: "11",
		name: "其他原因"
	},
	{
		id: "12",
		name: "到货时间"
	},
	{
		id: "15",
		name: "不知何时有货"
	},
	{
		id: "16",
		name: "下架"
	},
	{
		id: "17",
		name: "门店未开门"
	},
	{
		id: "3",
		name: "销退"
	}
];
// 指派拿货时间
export const ASSOGM_PICKUP_TIME = [
	{
		value: 1,
		label: "指派拿货时间"
	},
	{
		value: 2,
		label: "完成拿货时间"
	},
	{
		value: 3,
		label: "创建时间"
	},
	{
		value: 4,
		label: "支付时间"
	},
	{
		value: 5,
		label: "标记异常时间"
	}
];

// 组合装状态
export const COMB_STATUS = [
	{
		value: 1,
		label: "启用"
	},
	{
		value: 0,
		label: "禁用"
	},
	{
		value: 2,
		label: "备用"
	},
	{
		value: "",
		label: "全选"
	}
];
// 分拣墙
export const LETTER_LIST = [
	{
		value: "A",
		label: "A"
	},
	{
		value: "B",
		label: "B"
	},
	{
		value: "C",
		label: "C"
	},
	{
		value: "D",
		label: "D"
	},
	{
		value: "E",
		label: "E"
	},
	{
		value: "F",
		label: "F"
	},
	{
		value: "G",
		label: "G"
	},
	{
		value: "H",
		label: "H"
	},
	{
		value: "I",
		label: "I"
	},
	{
		value: "J",
		label: "J"
	},
	{
		value: "K",
		label: "K"
	},
	{
		value: "L",
		label: "L"
	},
	{
		value: "M",
		label: "M"
	},
	{
		value: "N",
		label: "N"
	},
	{
		value: "O",
		label: "O"
	},
	{
		value: "P",
		label: "P"
	},
	{
		value: "Q",
		label: "Q"
	},
	{
		value: "R",
		label: "R"
	},
	{
		value: "S",
		label: "S"
	},
	{
		value: "T",
		label: "T"
	},
	{
		value: "U",
		label: "U"
	},
	{
		value: "V",
		label: "V"
	},
	{
		value: "W",
		label: "W"
	},
	{
		value: "X",
		label: "X"
	},
	{
		value: "Y",
		label: "Y"
	},
	{
		value: "Z",
		label: "Z"
	}
];
// 库存同步到店铺
export const INVENTORY_SYNCHRONIZATION = [
	{
		value: 1,
		label: "可用库存"
	},
	{
		value: 2,
		label: "虚拟库存"
	}
];
// 启动状态
export const ENABLED_STATUS = [
	{
		value: 1,
		label: "启用中",
		type: "success"
	},
	{
		value: 0,
		label: "已停用",
		type: "danger"
	}
];
// 业务类型
export const BUSINESS_TYPE = [
	// {
	// 	value: "actual-num-count",
	// 	label: "正品盘点"
	// },
	// {
	// 	value: "defective-num-count",
	// 	label: "次品盘点"
	// },
	// {
	// 	value: "add-stock-change",
	// 	label: "增加库存"
	// },
	{
		value: "purchase-return",
		label: "销退入仓"
	},
	// {
	// 	value: "return-cancellation",
	// 	label: "采购退货单取消"
	// },
	{
		value: "goods-out-warehouse",
		label: "发货出仓"
	},
	// {
	// 	value: "return-goods-out-warehouse",
	// 	label: "退货出仓"
	// },
	{
		value: "check-stock-change",
		label: "库存校验"
	},
	{
		value: "adjust-inventory-out",
		label: "调仓出仓"
	},
	{
		value: "adjust-inventory-in",
		label: "调仓入仓"
	},
	// {
	// 	value: "release-inventory",
	// 	label: "释放库存"
	// },
	{
		value: "procurement-and-storage",
		label: "采购入仓"
	},
	{
		value: "outbound-order-out",
		label: "出库单出仓"
	},
	{
		value: "cancel-warehouse",
		label: "快销退货出仓"
	}
	// {
	// 	value: "goods-out-warehouse",
	// 	label: "发货出仓"
	// },
	// {
	// 	value: "cancel-warehouse",
	// 	label: "销退入库"
	// }
];
// 系统商品操作类型
export const GOODS_ACTION_TYPE = [
	{
		value: "default-running-volume",
		label: "设置默认跑量商品"
	},
	{
		value: "batch_update_sku_status",
		label: "设置sku状态"
	},
	{
		value: "batch_update_sku",
		label: "批量修改sku信息"
	},
	{
		value: "update_sku",
		label: "编辑商品"
	},
	{
		value: "update_sku_procure_price",
		label: "修改采购价"
	},
	{
		value: "update_sku_cost_price",
		label: "修改成本价"
	},
	{
		value: "match_sku_exact",
		label: "精准匹配"
	},
	{
		value: "match_sku_shop",
		label: "供应商匹配"
	},
	{
		value: "match_sku_del",
		label: "解除匹配"
	},
	{
		value: "match_sku_update",
		label: "更换匹配"
	},
	{
		value: "del_sku",
		label: "删除"
	},
	{
		value: "install_spu",
		label: "新增"
	},
	{
		value: "update_spu",
		label: "修改"
	},
	{
		value: "batch_update_spu",
		label: "批量修改"
	},
	{
		value: "batch_update_spu_status",
		label: "批量修改状态"
	},
	{
		value: "spu_running_volume",
		label: "批量修改状态"
	},
	{
		value: "del_spu",
		label: "删除"
	},
	{
		value: "match_spu",
		label: "供应商匹配"
	},
	{
		value: "match_spu_can_only",
		label: "智能匹配"
	},
	{
		value: "match_spu_senior",
		label: "高级匹配"
	},
	{
		value: "on-sync-stock",
		label: "启用库存同步"
	},
	{
		value: "off-sync-stock",
		label: "禁止库存同步"
	},
	{
		value: "apply_member_price",
		label: "申请会员价"
	},
	{
		value: "update_member_price",
		label: "更改会员价"
	},
	{
		value: "import_sys_sku_from_excel",
		label: "从Excel表导入商品资料"
	},
	{
		value: "match_sku_default_del",
		label: "解除默认匹配"
	},
	{
		value: "match_sku_not_default_del",
		label: "解除非默认匹配"
	},
	{
		value: "match_sku_all_del",
		label: "解除所有匹配"
	},
];
// 系统商品操作类型
export const STORE_GOODS_ACTION_TYPE = [
	{
		value: "on-shelf",
		label: "上架"
	},
	{
		value: "off-shelf",
		label: "下架"
	},
	{
		value: "update-sku-code",
		label: "编辑原始商品编码"
	},
	{
		value: "upload-sku-code",
		label: "上传原始商品编码"
	},
	{
		value: "update-spu-code",
		label: "编辑款式编码"
	},
	{
		value: "upload-spu-code",
		label: "上传款式编码"
	},
	{
		value: "update-stock",
		label: "修改库存"
	},
	{
		value: "sync-stock-by-hand",
		label: "手动同步库存"
	},
	{
		value: "on-sync-stock",
		label: "启用库存同步"
	},
	{
		value: "off-sync-stock",
		label: "禁止库存同步"
	},
	{
		value: "hand_generate_sys_goods",
		label: "手动生成系统商品",
	}
];
// 查看日志状态
export const LOG_STATUS = [
	{
		value: 0,
		label: "成功"
	},
	{
		value: 1,
		label: "失败"
	}
];

// 入库单状态
export const WAREHOUSE_STATUS = [
	{
		value: "wait-inboundOrder",
		label: "待入库"
	},
	{
		value: "partial-inboundOrder",
		label: "部分入库"
	},
	{
		value: "complete",
		label: "完成"
	},
	{
		value: "cancelled",
		label: "作废"
	}
];
// 商品出库单状态
export const GOODS_OUTBOUND_STATUS = [
	{
		value: "0",
		label: "待审核"
	},
	{
		value: "1",
		label: "待出库"
	},
	{
		value: "2",
		label: "部分出库"
	},
	{
		value: "3",
		label: "完成"
	},
	{
		value: "4",
		label: "作废"
	}
];
// 来源类型
export const SOURCE_TYPE = [
	{
		value: "purchase-order",
		label: "采购单"
	},
	{
		value: "after-sales-order",
		label: "售后单"
	},
	{
		value: "manual-creation",
		label: "手动创建"
	},
	{
		value: "return-warehousing",
		label: "退供转入仓"
	},
];
// 仓库类型
export const WAREHOUSE_TYPE = [
	{
		value: 1,
		label: "发货仓"
	},
	{
		value: 2,
		label: "次品仓"
	},
	{
		value: 3,
		label: "销退仓"
	}
];
// 采购单状态
export const PURCHASE_STATUS = [
	{
		value: "wait-audit",
		label: "待审核"
	},
	{
		value: "wait-pickup",
		label: "待拿货"
	},
	{
		value: "partial-pickup",
		label: "部分拿货"
	},
	{
		value: "complete",
		label: "完成"
	},
	{
		value: "cancelled",
		label: "作废"
	}
];
//入库仓库
export const INCOMING_WAREHOUSE = [
	{
		value: 0,
		label: "仓库1(发货仓)"
	},
	{
		value: 1,
		label: "仓库2(发货仓)"
	},
	{
		value: 2,
		label: "仓库3(次品仓)"
	},
	{
		value: 3,
		label: "仓库4(销退仓)"
	}
];
// 商品数量
export const GOODS_NUMBER = [
	{
		value: 1,
		label: "商品数小于等于"
	},
	{
		value: 3,
		label: "商品数等于"
	},
	{
		value: 2,
		label: "商品数大于等于"
	}
];
// 展示规则
export const STOCK_RULE = [
	{
		value: "1",
		label: "所有库存为0时隐藏该商品"
	},
	{
		value: "0",
		label: "所有库存为0时不隐藏该商品"
	}
];
 
// 组合商品日志操作类型
export const COMB_LOG_ACTION_TYPE = [
	{
		value: "update-goods-combination",
		label: "修改组合装资料"
	},
	{
		value: "save-by-hand",
		label: "手动创建"
	},
	{
		value: "save-by-automatic",
		label: "自动创建"
	},
	{
		value: "save-from-excel",
		label: "从Excel表导入新增"
	},
	{
		value: "update-from-excel",
		label: "从Excel表导入修改"
	}
];
